<template>
  <h1>我是App组件</h1>
  <h3>姓名:{{ name }}</h3>
  <h3>年龄:{{ age }}</h3>
  <h3>工作种类:{{ job.type }}</h3>
  <h3>工作薪资:{{ job.salary }}</h3>
  <button @click="changeInfo">修改人的信息</button>
</template>

<script>
import { ref } from "vue";
export default {
  name: "App",
  setup() {
    let name = ref("张三");
    let age = ref(18);
    let job = ref({
      type: "程序员",
      salary: "50K",
    });
    function changeInfo() {
      name.value = "李四";
      age.value = 36;
      job.value.type = "项目经理";
      job.value.salary = "100K";
    }
    return {
      name,
      age,
      changeInfo,
      job,
    };
  },
};
</script>

<style>
</style>
